﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Web_Portal
{
    public partial class MainPage : UserControl
    {
        private ServiceReference1.InternalBookingServiceClient service = null;

        public MainPage()
        {
            InitializeComponent();
            service  = new ServiceReference1.InternalBookingServiceClient();
            service.GetPhoneCompleted += service_GetPhoneCompleted;
        }

        void service_GetPhoneCompleted(object sender, ServiceReference1.GetPhoneCompletedEventArgs e)
        {
            txtResult.Text = ""+ e.Result.IsPrimary;
        }

        private void BtnClick1(object sender, RoutedEventArgs e)
        {
            Int32 phoneNumber = 0;
            Int32.TryParse(txtPhone.Text, out phoneNumber);
            service.GetPhoneAsync(phoneNumber);
        }

    }
}
